module.exports = function (method, url,query) {
    let baseUrl = 'http://localhost:8000/';
    return new Promise((resolve)=>{
        let xhr = new XMLHttpRequest();
        xhr.open(method, baseUrl+url, true);
        xhr.onreadystatechange = function () {
            if (xhr.readyState === 4) {
                resolve(xhr)
            }
        }
        xhr.send(query) //
    })
}